package org.jeecg.modules.online.graphreport.service.impl;

import org.jeecg.modules.online.graphreport.entity.OnlGraphreportTempletItem;
import org.jeecg.modules.online.graphreport.mapper.OnlGraphreportTempletItemMapper;
import org.jeecg.modules.online.graphreport.service.IOnlGraphreportTempletItemService;
import org.springframework.stereotype.Service;
import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: Online报表多数据源次表
 * @Author: jeecg-boot
 * @Date:2019-04-17
 * @Version:V1.0
 */
@Service("onlGraphreportTempletItemServiceImpl")
public class OnlGraphreportTempletItemServiceImpl extends ServiceImpl<OnlGraphreportTempletItemMapper, OnlGraphreportTempletItem> implements IOnlGraphreportTempletItemService {

	@Autowired
	private OnlGraphreportTempletItemMapper onlGraphreportTempletItemMapper;

	@Override
	public List<OnlGraphreportTempletItem> selectByMainId(String mainId) {
		QueryWrapper<OnlGraphreportTempletItem> itemsQueryWrapper = new QueryWrapper<OnlGraphreportTempletItem>();
		itemsQueryWrapper.eq("graphreport_templet_id", mainId);
		itemsQueryWrapper.orderByAsc("group_num");
		itemsQueryWrapper.orderByAsc("order_num");
		List<OnlGraphreportTempletItem> templetItems = onlGraphreportTempletItemMapper.selectList(itemsQueryWrapper);
		return templetItems;
	}
}
